package com.baomidou.springboot.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.springboot.entity.TbUser;
import com.baomidou.springboot.mapper.TbUserMapper;
import com.baomidou.springboot.service.TbUserService;
import org.springframework.stereotype.Service;
import java.util.List;
import javax.annotation.Resource;

@Service
public class TbUserServiceImpl extends ServiceImpl<TbUserMapper, TbUser> implements TbUserService {

    @Resource
    private TbUserMapper tbUserMapper;

    @Override
    public List<TbUser> list() {
        return tbUserMapper.selectList(null);
    }

    @Override
    public TbUser getById(Integer id) {
        return tbUserMapper.selectById(id);
    }

    @Override
    public boolean save(TbUser user) {
        return tbUserMapper.insert(user) > 0;
    }

    @Override
    public boolean updateById(TbUser user) {
        return tbUserMapper.updateById(user) > 0;
    }

    @Override
    public boolean removeById(Integer id) {
        return tbUserMapper.deleteById(id) > 0;
    }
}
